<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org"
xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head th:replace="/common/common_header :: commonHeader(~{::title},~{::link})">
	<title>INSPINIA | Login</title>
	<link rel="stylesheet" th:href="@{/css/login.css}" href="/css/login.css" />
</head>

<body class="container gray-bg">

	<div class="middle-box text-center loginscreen animated fadeInDown">
		<div>
			<div>
				<h2 class="logo-name">芭蕉问答</h2>
			</div>
			<h3>欢迎进入芭蕉问答</h3>
			<p>快乐至上</p>
			<form class="m-t" role="form" th:action="@{/checkLogin}" action="#" method="post">
				<div class="form-group">
					<input type="text" class="form-control" placeholder="username" name="username" required="" />
				</div>
				<div class="form-group">
					<input type="password" class="form-control" placeholder="password" name="password" required="" />
				</div>
				<div class="from-group kaptcha">
					<input class="form-control kaptcha-input" type="text" placeholder="验证码" name="code"/>
					<img class="kaptcha-img" src="/defaultKaptcha" onclick="this.src='/defaultKaptcha?d='+new Date()"/>
				</div>
				<div class="form-group rememberMe">
					<div class="checkbox i-checks">
						<label> <input type="checkbox" name="rememberMe" value="1"/><i></i> 记住我. </label>&nbsp;&nbsp;&nbsp;
					</div>
					<div class="forgot">
						<a th:href="@{register}" href="#"><small>忘记密码?</small></a>
					</div>
				</div>

				<button type="submit" class="btn btn-primary block full-width m-b">登录</button>
				<p class="text-muted text-center">
					<small>还没有账号？</small>
				</p>
				<a class="btn btn-sm btn-white btn-block" th:href="@{register}" href="register.html">创建账号</a>
			</form>
			<p class="m-t">
				<small>Copyright 芭蕉问答&copy;2017-2018</small>
			</p>
		</div>
	</div>

	<th:block th:replace="/common/common_js :: commonJs"></th:block>
	<script th:inline="javascript">
		var error = [[${error}]];
		$(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
			if(error!=null){
				 swal({
		         	title : "温馨提示",
		         	text : error
		      	});
			}
		});

	</script>
</body>

</html>
